hvm: Do not crash guest if it does an unaligned access to an HPET
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 21 Nov 2007 09:49:09 +0000 (09:49 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 21 Nov 2007 09:49:09 +0000 (09:49 +0000)
register. Some CrashMe test apaprently does this and we don't want
that to crash the domain it runs in.
From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
xen/arch/x86/hvm/hpet.c

index 595495580991ed9d73304e21b5eea1778c97673d..ee7d91f652dd68514fdd7db2c05cb0c1aeda0c2e 100644 (file)
@@ -127,9 +127,13 @@ static inline int hpet_check_access_length(
 {
     if ( (addr & (len - 1)) || (len > 8) )
     {
-        gdprintk(XENLOG_ERR, "HPET: access across register boundary: "
+        /*
+         * According to ICH9 specification, unaligned accesses may result
+         * in unexpected behaviour or master abort, but should not crash/hang.
+         * Hence we read all-ones, drop writes, and log a warning.
+         */
+        gdprintk(XENLOG_WARNING, "HPET: access across register boundary: "
                  "%lx %lx\n", addr, len);
-        domain_crash(current->domain);
         return -EINVAL;
     }